package com.xayy.health.mgt.controller;

import cn.kawins.base.result.ResultBody;
import cn.kawins.mybatis.base.BaseController;
import com.xayy.health.mgt.model.HealthAssessTask;
import com.xayy.health.mgt.service.HealthAssessTaskService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author Nie
 * @version V1.0 @ Date 2024/6/6 14:27
 */
@RestController
@RequestMapping("/healthAssessTask")
@Api(tags = "健康管理评估自动任务模块")
public class HealthAssessTaskController extends BaseController<HealthAssessTask> {

    @Autowired
    private HealthAssessTaskService healthAssessTaskService;

    @GetMapping("/{satelliteMid}")
    @ApiOperation(value = "查询卫星任务信息")
    public ResultBody getSatTaskInfo(@PathVariable Long satelliteMid) {
        return healthAssessTaskService.getSatTaskInfo(satelliteMid).body();
    }

    @PostMapping("taskResult")
    @ApiOperation(value = "开启卫星健康评估任务")
    public ResultBody startHealthAssessTask(@RequestBody HealthAssessTask healthAssessTask) {
        return healthAssessTaskService.healthAutoRunTask(healthAssessTask).body();
    }
}
